@@ -1,4 +1,4 @@
Build Makefile
_build blib
-META.yml Makefile.PL SIGNATURE
+META.yml MYMETA.yml Makefile.PL SIGNATURE
Authen-Passphrase-*
@@ -1,3 +1,4 @@
+{ use 5.006; }
use warnings;
use strict;
@@ -6,6 +7,12 @@ use Module::Build;
Module::Build->new(
module_name => "Authen::Passphrase",
license => "perl",
+ configure_requires => {
+ "Module::Build" => 0,
+ "perl" => "5.006",
+ "strict" => 0,
+ "warnings" => 0,
+ },
build_requires => {
"MIME::Base64" => "2.21",
"Module::Build" => 0,
@@ -17,9 +24,9 @@ Module::Build->new(
requires => {
"Authen::DecHpwd" => "2.003",
"Carp" => 0,
- "Crypt::Blowfish" => "2.00",
"Crypt::DES" => 0,
- "Crypt::Eksblowfish::Bcrypt" => "0.005",
+ "Crypt::Eksblowfish::Bcrypt" => "0.008",
+ "Crypt::Eksblowfish::Uklblowfish" => "0.008",
"Crypt::MySQL" => "0.03",
"Crypt::PasswdMD5" => "1.0",
"Crypt::UnixCrypt_XS" => "0.08",
@@ -29,10 +36,9 @@ Module::Build->new(
"Digest::MD5" => "1.9953",
"Digest::SHA1" => 0,
"MIME::Base64" => "2.21",
- "Module::Runtime" => "0.005",
+ "Module::Runtime" => "0.006",
"Params::Classify" => 0,
- "base" => 0,
- "fields" => 0,
+ "parent" => 0,
"perl" => "5.006",
"strict" => 0,
"warnings" => 0,
@@ -43,4 +49,4 @@ Module::Build->new(
sign => 1,
)->create_build_script;
-exit 0;
+1;
@@ -1,3 +1,37 @@
+version 0.007; 2010-07-30
+
+ * bugfix: in A::P::SaltedDigest, use "[0-9a-zA-Z_]" instead of "\w"
+ in regexps where only ASCII characters are desired
+
+ * bugfix: in A::P::BlowfishCrypt, require bugfixed version of
+ Crypt::Eksblowfish (for memory leak fix)
+
+ * bugfix: in A::P::SaltedDigest, require bugfixed version of
+ Module::Runtime (for ASCII restriction of module name syntax)
+
+ * in A::P::EggdropBlowfish, use Crypt::Eksblowfish::Uklblowfish instead
+ of Crypt::Blowfish to remove limitation on passphrase length
+
+ * abandon use of the "fields" module
+
+ * use simpler "parent" pragma in place of "base"
+
+ * in documentation, use the term "truth value" instead of the less
+ precise "boolean"
+
+ * in A::P documentation, add MooseX::Types::Authen::Passphrase to
+ "see also" list
+
+ * check for required Perl version at runtime
+
+ * use full stricture in test suite
+
+ * in Build.PL, explicitly declare configure-time requirements
+
+ * remove bogus "exit 0" from Build.PL
+
+ * add MYMETA.yml to .cvsignore
+
version 0.006; 2009-03-07
* bugfix: in A::P::SaltedDigest, use "[0-9]" instead of "\d" in regexps
@@ -1,102 +1,106 @@
---
-name: Authen-Passphrase
-version: 0.006
+abstract: 'hashed passwords/passphrases as objects'
author:
- 'Andrew Main (Zefram) <zefram@fysh.org>'
-abstract: hashed passwords/passphrases as objects
-license: perl
-resources:
- license: ~
-requires:
- Authen::DecHpwd: 2.003
- Carp: 0
- Crypt::Blowfish: 2.00
- Crypt::DES: 0
- Crypt::Eksblowfish::Bcrypt: 0.005
- Crypt::MySQL: 0.03
- Crypt::PasswdMD5: 1.0
- Crypt::UnixCrypt_XS: 0.08
- Data::Entropy::Algorithms: 0
- Digest: 1.00
- Digest::MD4: 1.2
- Digest::MD5: 1.9953
- Digest::SHA1: 0
+build_requires:
MIME::Base64: 2.21
- Module::Runtime: 0.005
- Params::Classify: 0
- base: 0
- fields: 0
+ Module::Build: 0
+ Test::More: 0
perl: 5.006
strict: 0
warnings: 0
-build_requires:
- MIME::Base64: 2.21
+configure_requires:
Module::Build: 0
- Test::More: 0
perl: 5.006
strict: 0
warnings: 0
+distribution_type: module
dynamic_config: 0
+generated_by: 'Module::Build version 0.3607'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Authen-Passphrase
provides:
Authen::Passphrase:
file: lib/Authen/Passphrase.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::AcceptAll:
file: lib/Authen/Passphrase/AcceptAll.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::BigCrypt:
file: lib/Authen/Passphrase/BigCrypt.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::BlowfishCrypt:
file: lib/Authen/Passphrase/BlowfishCrypt.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::Clear:
file: lib/Authen/Passphrase/Clear.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::Crypt16:
file: lib/Authen/Passphrase/Crypt16.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::DESCrypt:
file: lib/Authen/Passphrase/DESCrypt.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::EggdropBlowfish:
file: lib/Authen/Passphrase/EggdropBlowfish.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::LANManager:
file: lib/Authen/Passphrase/LANManager.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::LANManagerHalf:
file: lib/Authen/Passphrase/LANManagerHalf.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::MD5Crypt:
file: lib/Authen/Passphrase/MD5Crypt.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::MySQL323:
file: lib/Authen/Passphrase/MySQL323.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::MySQL41:
file: lib/Authen/Passphrase/MySQL41.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::NTHash:
file: lib/Authen/Passphrase/NTHash.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::NetscapeMail:
file: lib/Authen/Passphrase/NetscapeMail.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::PHPass:
file: lib/Authen/Passphrase/PHPass.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::RejectAll:
file: lib/Authen/Passphrase/RejectAll.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::SaltedDigest:
file: lib/Authen/Passphrase/SaltedDigest.pm
- version: 0.006
+ version: 0.007
Authen::Passphrase::VMSPurdy:
file: lib/Authen/Passphrase/VMSPurdy.pm
- version: 0.006
-generated_by: Module::Build version 0.31012
-meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-distribution_type: module
+ version: 0.007
+requires:
+ Authen::DecHpwd: 2.003
+ Carp: 0
+ Crypt::DES: 0
+ Crypt::Eksblowfish::Bcrypt: 0.008
+ Crypt::Eksblowfish::Uklblowfish: 0.008
+ Crypt::MySQL: 0.03
+ Crypt::PasswdMD5: 1.0
+ Crypt::UnixCrypt_XS: 0.08
+ Data::Entropy::Algorithms: 0
+ Digest: 1.00
+ Digest::MD4: 1.2
+ Digest::MD5: 1.9953
+ Digest::SHA1: 0
+ MIME::Base64: 2.21
+ Module::Runtime: 0.006
+ Params::Classify: 0
+ parent: 0
+ perl: 5.006
+ strict: 0
+ warnings: 0
+resources:
+ license: http://dev.perl.org/licenses/
+version: 0.007
@@ -1,32 +1,35 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.31012
+# Note: this file was auto-generated by Module::Build::Compat version 0.3607
require 5.006;
-
+
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
-
+
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
-
+
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
-
+
require Cwd;
require File::Spec;
require CPAN;
-
+
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
-
+
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
-
+
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
Module::Build::Compat->run_build_pl(args => \@ARGV);
+ my $build_script = 'Build';
+ $build_script .= '.com' if $^O eq 'VMS';
+ exit(0) unless(-e $build_script); # cpantesters convention
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
@@ -29,7 +29,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
LICENSE
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.55.
+signed via the Module::Signature module, version 0.64.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,60 +14,60 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 9f4a64d9e7786d6f683c250a2138566417fda453 .cvsignore
-SHA1 896db9c43146841cb7602cced288addc97e073be Build.PL
-SHA1 e66d67f9d9328e4fb4fe0e3fd9190c916c52bed9 Changes
+SHA1 0ad3ed14e18f6a1a6846884371ef7e8d79c8dc2b .cvsignore
+SHA1 ae22d1df85e28423f5922f8c0edfd68f432c1622 Build.PL
+SHA1 a63082ccd1ed77571e383f33efa0077f78d4b50e Changes
SHA1 57819ff9232fde9c8f3425b52dc5409ec40c0e13 MANIFEST
-SHA1 fbb2c70e4007fcb5e6ead86cd806da48c2707ebe META.yml
-SHA1 f39315b8e83202006e8a916c6a58725d104f75ec Makefile.PL
-SHA1 9677d11f64aa4dc10154197581bafd5b367946c7 README
-SHA1 937f2dbf930447440695c27b834b4086358131af lib/Authen/Passphrase.pm
-SHA1 d8c8dca3cbcf94a2fba56f34c74d9329e340816a lib/Authen/Passphrase/AcceptAll.pm
-SHA1 bd9c3e09987f8dc9773b07f8c11b3c66701a6f4c lib/Authen/Passphrase/BigCrypt.pm
-SHA1 ebdd44e0475352bcfa0b32a8636a54f9f4cc81db lib/Authen/Passphrase/BlowfishCrypt.pm
-SHA1 d1007138d6baa0ce60247ba24474e5bf591eb2f5 lib/Authen/Passphrase/Clear.pm
-SHA1 3059bf4db8ddd54ab5d88646ade20ebb4b14194f lib/Authen/Passphrase/Crypt16.pm
-SHA1 0b0d3e2ef45999c60b50e7eeef13e3cb4e7f3292 lib/Authen/Passphrase/DESCrypt.pm
-SHA1 36cd19a485e14bdfb0b1eae3da130845578ce69f lib/Authen/Passphrase/EggdropBlowfish.pm
-SHA1 bd2adcdb1f36aec97590c0edce2b705d9f506713 lib/Authen/Passphrase/LANManager.pm
-SHA1 a2a0701ba49dc5d7e7bdd322e40aaa625d650600 lib/Authen/Passphrase/LANManagerHalf.pm
-SHA1 cca7f3d75584393422bde54843cbcdb3e5fb3fae lib/Authen/Passphrase/MD5Crypt.pm
-SHA1 8b06d373f20b0158a23cacefdb6d2ecd8453cb55 lib/Authen/Passphrase/MySQL323.pm
-SHA1 086fd0125996f006d0e096da343e3018b48b56d2 lib/Authen/Passphrase/MySQL41.pm
-SHA1 4718041fc556251951d9621f72329053d5d7729c lib/Authen/Passphrase/NTHash.pm
-SHA1 42f8ec985611f87ec05fdd0f23a7f6a35f710de3 lib/Authen/Passphrase/NetscapeMail.pm
-SHA1 98802231671712240dac8a4a32f2cfd7ec03fc67 lib/Authen/Passphrase/PHPass.pm
-SHA1 f5a5f374acc924234f6ac29a3f05575c62f85e7a lib/Authen/Passphrase/RejectAll.pm
-SHA1 5685d72f8a63b64f585af7da9391a5d1978d6e45 lib/Authen/Passphrase/SaltedDigest.pm
-SHA1 d06ad07201151d94ad2f638e9e12f63b21bb23d5 lib/Authen/Passphrase/VMSPurdy.pm
-SHA1 df301e86bf5f705e8400f506fe97616d7bd33b3d t/acceptall.t
-SHA1 84286627d33fd39ec927d3b44c7fd651a6eacce8 t/bigcrypt.t
-SHA1 5d439d0a48f93b9287e03dc9e2c966faf6c87344 t/blowfishcrypt.t
-SHA1 06a33b31863d188857f29817fc12e6d5f565b092 t/clear.t
-SHA1 806abc2605de060ff20d0cc2416dc9c1a6688ee9 t/crypt16.t
-SHA1 2fd7fb851f89bf25676d880bfa3ec15277bc5895 t/eggdropblowfish.t
-SHA1 a91904ea02cc49984f811249e9b97a5a5a6fb541 t/extdescrypt.t
-SHA1 c8bc062b953b9f543efc4371bf6cd50b737e7b8f t/gendescrypt.t
-SHA1 20e146d9f938af7f3727668f8e5598f11b3c0bb1 t/intdescrypt.t
-SHA1 539dbee9955695b1592ea8a4024a31b0d66f2008 t/lanman.t
-SHA1 f242d99380cb82f688fd5bbcabf85b02e0cd5a5f t/lanmanhalf.t
-SHA1 f91d9bbb8a5448888213b78cbb50c2da7bbf1aaf t/md5crypt.t
-SHA1 82ec239808a21dd2f1727f47be449d8c5c778969 t/mysql323.t
-SHA1 82ecab9471c6cc3f257ccf2b166068587bc8a3a5 t/mysql41.t
-SHA1 5f153b3a68a53e2fb6ad72a6ffd05ea2f42a3dd9 t/netscapemail.t
-SHA1 4934ea1fffa362c2b1c68db78cb9a4f7cf9c224f t/nthash.t
-SHA1 2453f0b00f64349b879d5e8ccad34990c3b7925a t/phpass.t
-SHA1 0e141eecf3ca4903ef38d9413b5403a9ddb0392f t/pod_cvg.t
-SHA1 74a957cd8b93f25672ecc6aa578a671d084dd343 t/pod_syn.t
-SHA1 f961c0c4b2b34ecfc813067e75602885e3e07c6d t/rejectall.t
-SHA1 cfdbfb5cd8b65a8230a08ae914acec3ea26c52d6 t/smd5.t
-SHA1 086cf28ee4f5ed3324c9f624d0c82328c48600ab t/ssha.t
-SHA1 85fd77484de9f9f9e628738739a8bdd1a93cc24c t/traddescrypt.t
-SHA1 f889fcef78c45d887edd393e17acabe406cd2faa t/vmspurdy.t
+SHA1 9199295615dbad3e772f09e43c5fbf160996e797 META.yml
+SHA1 caae608231ffe78390c76451ade51a7cfc87a9f9 Makefile.PL
+SHA1 d28d9615dba876f29415425305a29f74360a6e9f README
+SHA1 3a365ebcdd2196e9186b43672ac3b1b08bfe3a59 lib/Authen/Passphrase.pm
+SHA1 3d0ecc810d838c7e10c0b1a9b712865031029998 lib/Authen/Passphrase/AcceptAll.pm
+SHA1 e2400ef277aec3664cf46d2a0a79d8b47ee3e0ed lib/Authen/Passphrase/BigCrypt.pm
+SHA1 e4720e0252acf9468cf355b98d27c5f66b9c013a lib/Authen/Passphrase/BlowfishCrypt.pm
+SHA1 4dfe73e50ce7248821480f33af0887f3ba231ec4 lib/Authen/Passphrase/Clear.pm
+SHA1 9912ffd84d1c342c4b56abb4397c5a688df9c97c lib/Authen/Passphrase/Crypt16.pm
+SHA1 81e280778f131f8115ec8bd0f11be6cb094902aa lib/Authen/Passphrase/DESCrypt.pm
+SHA1 d8fed5ee17fe955da1197847f792900457a1f223 lib/Authen/Passphrase/EggdropBlowfish.pm
+SHA1 2f023c6c4ebd1edb15fa3debae42a81684bba33e lib/Authen/Passphrase/LANManager.pm
+SHA1 653522e7e98bd8251eaddf5995491ebc8a4c6d34 lib/Authen/Passphrase/LANManagerHalf.pm
+SHA1 5fd137a0ebe454691bb8ccd21b1eecbd18181a10 lib/Authen/Passphrase/MD5Crypt.pm
+SHA1 e7846735a3c4937b270bed0568c348dc02c8dda1 lib/Authen/Passphrase/MySQL323.pm
+SHA1 58562839e4397d878ab9932bcfa2e272df50d322 lib/Authen/Passphrase/MySQL41.pm
+SHA1 95f0c0564646ca65f92d377d694e86b0a4cb6c21 lib/Authen/Passphrase/NTHash.pm
+SHA1 be0cdfab4fcc8020231b9fa1a1ccd465ec607c52 lib/Authen/Passphrase/NetscapeMail.pm
+SHA1 3cb6370c740935dc6811eb7299234e3cbbae2eb2 lib/Authen/Passphrase/PHPass.pm
+SHA1 4d6eb5a2055c3a6eea08459d9755ba7f34a87c1c lib/Authen/Passphrase/RejectAll.pm
+SHA1 698ce866107c4a7d756551991849be574685492f lib/Authen/Passphrase/SaltedDigest.pm
+SHA1 75b61dfd802ac243f078a556a55275a48c4df01d lib/Authen/Passphrase/VMSPurdy.pm
+SHA1 701b95f420406bb412f27ce12bbabd4e2c388284 t/acceptall.t
+SHA1 c3888dbc795188d78a5498fed6167143d9aaed8f t/bigcrypt.t
+SHA1 a62299eeccc77e682893549122cba19558b6f5b9 t/blowfishcrypt.t
+SHA1 63691c2ef336fddaa8f9a131d8bc32539c5395b5 t/clear.t
+SHA1 022e065813caf9d462df1a52c7c48ad04feafbb0 t/crypt16.t
+SHA1 006723ca9e3d56b57444f55e4cd5c9da76f26410 t/eggdropblowfish.t
+SHA1 eb7784180618d43171420d6c72f7d64210c4c6bf t/extdescrypt.t
+SHA1 e625976a80c74e79718278ce36f50dfa40c72cad t/gendescrypt.t
+SHA1 2fd7ec5f8a364a541d161249bb8132e78846ded7 t/intdescrypt.t
+SHA1 4168299f662fa8c10f2924790fb6a7887c9c3e9d t/lanman.t
+SHA1 b45c94717b50731f513a60a3b8b792d0610c85da t/lanmanhalf.t
+SHA1 b5b993f5a8141fd3562893f69af313b70bc0a074 t/md5crypt.t
+SHA1 183801ccda7843e9a07746395618a9b4e9a5f94b t/mysql323.t
+SHA1 7b4dedc232b78764aa493216818ec5d62944d5cb t/mysql41.t
+SHA1 957e5eb52221c1ccb139984757e00774dc49a398 t/netscapemail.t
+SHA1 0334ae266aa54c7b03019b95bf156afac05ac288 t/nthash.t
+SHA1 1f09f3f17eb280eec2791d2dffdfc3936fabe173 t/phpass.t
+SHA1 904d9a4f76525e2303e4b0c168c68230f223c8de t/pod_cvg.t
+SHA1 65c75abdef6f01a5d1588a307f2ddfe2333dc961 t/pod_syn.t
+SHA1 e3962e176588f0498b58b16c989fa1a674ee861f t/rejectall.t
+SHA1 3a48f131cf21940c853f01690ccf19c18f6a0eac t/smd5.t
+SHA1 dec2ee0c0b163930850cf1942485877a855fe45d t/ssha.t
+SHA1 c9ef4b2237f83808e82f864775684a42c1a4f43c t/traddescrypt.t
+SHA1 66c4083e0684fdc049a1fdcff3e93f0cdf80e120 t/vmspurdy.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
-iEYEARECAAYFAkmyVzkACgkQOV9mt2VyAVHaoQCgjKyD0s0sZdoDYlvjWoc+4Nv7
-J38An2Lfoq3DNU9a09FmuG4W5CA3vQhk
-=CsnD
+iEYEARECAAYFAkxTHMMACgkQOV9mt2VyAVG/IACfaEa8AkUpwk7edCrT1N4QxcxY
+lhkAn2ZccdTQroMtTuvHFr20PD0gMkyy
+=jK0V
-----END PGP SIGNATURE-----
@@ -36,15 +36,16 @@ be public in a system that expects some type of passphrase access control.
package Authen::Passphrase::AcceptAll;
+{ use 5.006; }
use warnings;
use strict;
use Authen::Passphrase 0.003;
use Carp qw(croak);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
+use parent "Authen::Passphrase";
# There is only one object of this class, and its content is
# insignificant.
@@ -123,7 +124,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -65,6 +65,7 @@ security than the plain DES scheme alone. Do not use seriously.
package Authen::Passphrase::BigCrypt;
+{ use 5.006; }
use warnings;
use strict;
@@ -74,9 +75,9 @@ use Carp qw(croak);
use Crypt::UnixCrypt_XS 0.08 qw(base64_to_block base64_to_int12);
use Data::Entropy::Algorithms 0.000 qw(rand_int);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTOR
@@ -280,7 +281,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -81,18 +81,18 @@ L<Authen::Passphrase::SaltedDigest> for more efficient hash algorithms.
package Authen::Passphrase::BlowfishCrypt;
+{ use 5.006; }
use warnings;
use strict;
use Authen::Passphrase 0.003;
use Carp qw(croak);
-use Crypt::Eksblowfish::Bcrypt 0.005 qw(bcrypt_hash en_base64 de_base64);
+use Crypt::Eksblowfish::Bcrypt 0.008 qw(bcrypt_hash en_base64 de_base64);
use Data::Entropy::Algorithms 0.000 qw(rand_bits);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(key_nul cost salt hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -107,7 +107,7 @@ crypt() algorithm. The following attributes may be given:
=item B<key_nul>
-Boolean indicating whether to append a NUL to the passphrase before using
+Truth value indicating whether to append a NUL to the passphrase before using
it as a key. The algorithm as originally devised does not do this,
but it was later modified to do it. The version that does append NUL
is to be preferred. Default true.
@@ -154,7 +154,7 @@ The cost and salt must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::BlowfishCrypt $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -253,13 +253,13 @@ crypt() algorithm, from an RFC 2307 string. The string must consist of
=item $ppr->key_nul
-Returns a boolean indicating whether a NUL will be appended to the
+Returns a truth value indicating whether a NUL will be appended to the
passphrase before using it as a key.
=cut
sub key_nul {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return $self->{key_nul};
}
@@ -271,7 +271,7 @@ be performed.
=cut
sub cost {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return $self->{cost};
}
@@ -290,7 +290,7 @@ Returns the salt, as a string of sixteen bytes.
=cut
sub salt {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -301,7 +301,7 @@ Returns the salt, as a string of 22 base 64 digits.
=cut
sub salt_base64 {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return en_base64($self->{salt});
}
@@ -312,7 +312,7 @@ Returns the hash value, as a string of 23 bytes.
=cut
sub hash {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -323,7 +323,7 @@ Returns the hash value, as a string of 31 base 64 digits.
=cut
sub hash_base64 {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
return en_base64($self->{hash});
}
@@ -338,8 +338,7 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return bcrypt_hash({
key_nul => $self->{key_nul},
cost => $self->{cost},
@@ -348,13 +347,12 @@ sub _hash_of {
}
sub match {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
sub as_crypt {
- my Authen::Passphrase::BlowfishCrypt $self = shift;
+ my($self) = @_;
croak "passphrase can't be expressed as a crypt string"
if $self->{cost} > 99;
return sprintf("\$2%s\$%02d\$%s%s", $self->key_nul ? "a" : "",
@@ -374,7 +372,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -30,15 +30,16 @@ know what you're doing.
package Authen::Passphrase::Clear;
+{ use 5.006; }
use warnings;
use strict;
use Authen::Passphrase 0.003;
use Carp qw(croak);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
+use parent "Authen::Passphrase";
# An object of this class is a blessed scalar containing the passphrase.
@@ -120,7 +121,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -62,6 +62,7 @@ security than the plain DES scheme alone. Do not use seriously.
package Authen::Passphrase::Crypt16;
+{ use 5.006; }
use warnings;
use strict;
@@ -71,10 +72,9 @@ use Carp qw(croak);
use Crypt::UnixCrypt_XS 0.08 qw(base64_to_block base64_to_int12);
use Data::Entropy::Algorithms 0.000 qw(rand_int);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(first_half second_half);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTOR
@@ -122,7 +122,7 @@ The salt must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::Crypt16 $self = fields::new($class);
+ my $self = bless({}, $class);
my $salt;
my $hash;
my $passphrase;
@@ -209,7 +209,7 @@ Returns the salt, as a Perl integer.
=cut
sub salt {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{first_half}->salt;
}
@@ -220,7 +220,7 @@ Returns the salt, as a string of two base 64 digits.
=cut
sub salt_base64_2 {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{first_half}->salt_base64_2;
}
@@ -231,7 +231,7 @@ Returns the hash value, as a string of 16 bytes.
=cut
sub hash {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{first_half}->hash.$self->{second_half}->hash;
}
@@ -244,7 +244,7 @@ a base64 encoding of the combined hash.
=cut
sub hash_base64 {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{first_half}->hash_base64.
$self->{second_half}->hash_base64;
}
@@ -257,7 +257,7 @@ C<Authen::Passphrase::DESCrypt> passphrase recogniser.
=cut
sub first_half {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{first_half};
}
@@ -269,7 +269,7 @@ C<Authen::Passphrase::DESCrypt> passphrase recogniser.
=cut
sub second_half {
- my Authen::Passphrase::Crypt16 $self = shift;
+ my($self) = @_;
return $self->{second_half};
}
@@ -280,8 +280,7 @@ This method is part of the standard C<Authen::Passphrase> interface.
=cut
sub match {
- my Authen::Passphrase::Crypt16 $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->{first_half}->match(substr($passphrase, 0, 8)) &&
$self->{second_half}->match(
length($passphrase) > 8 ? substr($passphrase, 8) : "");
@@ -300,7 +299,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -114,6 +114,7 @@ eleven give the hash.
package Authen::Passphrase::DESCrypt;
+{ use 5.006; }
use warnings;
use strict;
@@ -127,10 +128,9 @@ use Crypt::UnixCrypt_XS 0.08 qw(
);
use Data::Entropy::Algorithms 0.000 qw(rand_int);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(fold initial nrounds salt hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -145,7 +145,7 @@ DES-based crypt() algorithm. The following attributes may be given:
=item B<fold>
-Boolean indicating whether the BSDi passphrase folding scheme should be
+Truth value indicating whether the BSDi passphrase folding scheme should be
used for long passphrases. Default false, for compatibility with the
original DES-based scheme.
@@ -205,7 +205,7 @@ parameters default to those used in the original DES-based crypt().
sub new {
my $class = shift;
- my Authen::Passphrase::DESCrypt $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -340,12 +340,12 @@ crypt() algorithm, from an RFC 2307 string. The string must consist of
=item $ppr->fold
-Returns a boolean indicating whether passphrase folding is used.
+Returns a truth value indicating whether passphrase folding is used.
=cut
sub fold {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return $self->{fold};
}
@@ -356,7 +356,7 @@ Returns the initial block, as a string of eight bytes.
=cut
sub initial {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return $self->{initial};
}
@@ -367,7 +367,7 @@ Returns the initial block, as a string of eleven base 64 digits.
=cut
sub initial_base64 {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return block_to_base64($self->{initial});
}
@@ -378,7 +378,7 @@ Returns the number of encryption rounds, as a Perl integer.
=cut
sub nrounds {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return $self->{nrounds};
}
@@ -390,7 +390,7 @@ Returns the number of encryption rounds, as a string of four base
=cut
sub nrounds_base64_4 {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return int24_to_base64($self->{nrounds});
}
@@ -401,7 +401,7 @@ Returns the salt, as a Perl integer.
=cut
sub salt {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -413,7 +413,7 @@ doesn't fit into two digits.
=cut
sub salt_base64_2 {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
my $salt = $self->{salt};
croak "salt $salt doesn't fit into two digits" if $salt >= 4096;
return int12_to_base64($salt);
@@ -426,7 +426,7 @@ Returns the salt, as a string of four base 64 digits.
=cut
sub salt_base64_4 {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return int24_to_base64($self->{salt});
}
@@ -437,7 +437,7 @@ Returns the hash value, as a string of eight bytes.
=cut
sub hash {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -448,7 +448,7 @@ Returns the hash value, as a string of eleven base 64 digits.
=cut
sub hash_base64 {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
return block_to_base64($self->{hash});
}
@@ -465,21 +465,19 @@ These methods are part of the standard C<Authen::Passphrase> interface.
sub _hash_of {
- my Authen::Passphrase::DESCrypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
$passphrase = fold_password($passphrase) if $self->{fold};
return crypt_rounds($passphrase, $self->{nrounds}, $self->{salt},
$self->{initial});
}
sub match {
- my Authen::Passphrase::DESCrypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
sub as_crypt {
- my Authen::Passphrase::DESCrypt $self = shift;
+ my($self) = @_;
if(!$self->{fold} && $self->{initial} eq "\0\0\0\0\0\0\0\0" &&
$self->{nrounds} == 25 && $self->{salt} < 4096) {
return $self->salt_base64_2.$self->hash_base64;
@@ -504,7 +502,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -38,12 +38,6 @@ and the last six encode the first half. Within each half the bytes
are encoded in reverse order. The base 64 digits are "B<.>", "B</>",
"B<0>" to "B<9>", "B<a>" to "B<z>", "B<A>" to "B<Z>" (in that order).
-I<Note:> Due to the Blowfish key length restriction being strictly
-enforced in C<Crypt::Blowfish>, this module currently C<die>s if given
-a passphrase longer than 56 bytes. This limitation will be corrected
-in a future version. Passphrases shorter than 8 bytes are correctly
-handled despite Blowfish rules.
-
I<Warning:> The hash is small by modern standards, and the lack of salt
is a weakness in this scheme. For a scheme that makes better use of
Blowfish see L<Authen::Passphrase::BlowfishCrypt>.
@@ -52,17 +46,17 @@ Blowfish see L<Authen::Passphrase::BlowfishCrypt>.
package Authen::Passphrase::EggdropBlowfish;
+{ use 5.006; }
use warnings;
use strict;
use Authen::Passphrase 0.003;
use Carp qw(croak);
-use Crypt::Blowfish 2.00;
+use Crypt::Eksblowfish::Uklblowfish 0.008;
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(hash);
+use parent "Authen::Passphrase";
my $b64_digits =
"./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -124,7 +118,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::EggdropBlowfish $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -172,7 +166,7 @@ Returns the hash value, as a string of eight bytes.
=cut
sub hash {
- my Authen::Passphrase::EggdropBlowfish $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -183,7 +177,7 @@ Returns the hash value, as a string of twelve base 64 digits.
=cut
sub hash_base64 {
- my Authen::Passphrase::EggdropBlowfish $self = shift;
+ my($self) = @_;
return _en_base64($self->{hash});
}
@@ -194,22 +188,14 @@ This method is part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::EggdropBlowfish $self = shift;
- my($passphrase) = @_;
- # Crypt::Blowfish only accepts key lengths 8 to 56 (inclusive).
- # The Eggdrop version accepts lengths 1 upwards. Bytes after 72
- # have no effect.
- croak "Crypt::Blowfish won't accept a key longer than 56 bytes ".
- "(TODO: need up to 72)"
- if length($passphrase) > 56;
- $passphrase .= $passphrase while length($passphrase) < 8;
- my $cipher = Crypt::Blowfish->new($passphrase);
+ my($self, $passphrase) = @_;
+ $passphrase = substr($passphrase, 0, 72);
+ my $cipher = Crypt::Eksblowfish::Uklblowfish->new($passphrase);
return $cipher->encrypt("\xde\xad\xd0\x61\x23\xf6\xb0\x95");
}
sub match {
- my Authen::Passphrase::EggdropBlowfish $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $passphrase ne "" &&
$self->_hash_of($passphrase) eq $self->{hash};
}
@@ -219,7 +205,7 @@ sub match {
=head1 SEE ALSO
L<Authen::Passphrase>,
-L<Crypt::Blowfish>
+L<Crypt::Eksblowfish::Uklblowfish>
=head1 AUTHOR
@@ -227,7 +213,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -51,6 +51,7 @@ exceptionally weak design, flawed in pretty much every respect.
package Authen::Passphrase::LANManager;
+{ use 5.006; }
use warnings;
use strict;
@@ -58,10 +59,9 @@ use Authen::Passphrase 0.003;
use Authen::Passphrase::LANManagerHalf;
use Carp qw(croak);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(first_half second_half);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -94,7 +94,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::LANManager $self = fields::new($class);
+ my $self = bless({}, $class);
my $hash;
my $passphrase;
while(@_) {
@@ -176,7 +176,7 @@ Returns the hash value, as a string of 16 bytes.
=cut
sub hash {
- my Authen::Passphrase::LANManager $self = shift;
+ my($self) = @_;
return $self->{first_half}->hash.$self->{second_half}->hash;
}
@@ -187,7 +187,7 @@ Returns the hash value, as a string of 32 hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::LANManager $self = shift;
+ my($self) = @_;
return unpack("H*", $self->hash);
}
@@ -199,7 +199,7 @@ C<Authen::Passphrase::LANManagerHalf> passphrase recogniser.
=cut
sub first_half {
- my Authen::Passphrase::LANManager $self = shift;
+ my($self) = @_;
return $self->{first_half};
}
@@ -211,7 +211,7 @@ C<Authen::Passphrase::LANManagerHalf> passphrase recogniser.
=cut
sub second_half {
- my Authen::Passphrase::LANManager $self = shift;
+ my($self) = @_;
return $self->{second_half};
}
@@ -224,14 +224,12 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _passphrase_acceptable {
- my Authen::Passphrase::LANManager $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $passphrase =~ /\A[\x00-\xff]{0,14}\z/;
}
sub match {
- my Authen::Passphrase::LANManager $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_passphrase_acceptable($passphrase) &&
$self->{first_half}->match(substr($passphrase, 0, 7)) &&
$self->{second_half}->match(
@@ -241,7 +239,7 @@ sub match {
}
sub as_rfc2307 {
- my Authen::Passphrase::LANManager $self = shift;
+ my($self) = @_;
return "{LANMAN}".$self->hash_hex;
}
@@ -259,7 +257,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -54,6 +54,7 @@ exceptionally weak design, flawed in pretty much every respect.
package Authen::Passphrase::LANManagerHalf;
+{ use 5.006; }
use warnings;
use strict;
@@ -61,10 +62,9 @@ use Authen::Passphrase 0.003;
use Carp qw(croak);
use Crypt::DES;
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -97,7 +97,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::LANManagerHalf $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -171,7 +171,7 @@ Returns the hash value, as a string of 8 bytes.
=cut
sub hash {
- my Authen::Passphrase::LANManagerHalf $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -182,7 +182,7 @@ Returns the hash value, as a string of 16 hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::LANManagerHalf $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{hash});
}
@@ -197,14 +197,12 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _passphrase_acceptable {
- my Authen::Passphrase::LANManagerHalf $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $passphrase =~ /\A[\x00-\xff]{0,7}\z/;
}
sub _hash_of {
- my Authen::Passphrase::LANManagerHalf $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
$passphrase = uc($passphrase);
$passphrase = "\0".$passphrase."\0\0\0\0\0\0\0\0";
my $key = "";
@@ -217,14 +215,13 @@ sub _hash_of {
}
sub match {
- my Authen::Passphrase::LANManagerHalf $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_passphrase_acceptable($passphrase) &&
$self->_hash_of($passphrase) eq $self->{hash};
}
sub as_crypt {
- my Authen::Passphrase::LANManagerHalf $self = shift;
+ my($self) = @_;
return "\$LM\$".$self->hash_hex;
}
@@ -242,7 +239,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -77,6 +77,7 @@ sse L<Authen::Passphrase::BlowfishCrypt>.
package Authen::Passphrase::MD5Crypt;
+{ use 5.006; }
use warnings;
use strict;
@@ -85,10 +86,9 @@ use Carp qw(croak);
use Crypt::PasswdMD5 1.0 qw(unix_md5_crypt);
use Data::Entropy::Algorithms 0.000 qw(rand_int);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(salt hash_base64);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -130,7 +130,7 @@ The salt must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::MD5Crypt $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -212,7 +212,7 @@ Returns the salt, in raw form.
=cut
sub salt {
- my Authen::Passphrase::MD5Crypt $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -223,7 +223,7 @@ Returns the hash value, as a string of 22 base 64 digits.
=cut
sub hash_base64 {
- my Authen::Passphrase::MD5Crypt $self = shift;
+ my($self) = @_;
return $self->{hash_base64};
}
@@ -241,8 +241,7 @@ bytes, and it cannot contain any NUL or "B<$>" characters.
=cut
sub _hash_base64_of {
- my Authen::Passphrase::MD5Crypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
die "can't use a crypt-incompatible salt yet ".
"(need generalised Crypt::MD5Passwd)"
if $self->{salt} =~ /[^\!-\#\%-9\;-\~]/ ||
@@ -253,13 +252,12 @@ sub _hash_base64_of {
}
sub match {
- my Authen::Passphrase::MD5Crypt $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_base64_of($passphrase) eq $self->{hash_base64};
}
sub as_crypt {
- my Authen::Passphrase::MD5Crypt $self = shift;
+ my($self) = @_;
croak "can't put this salt into a crypt string"
if $self->{salt} =~ /[^\!-\#\%-9\;-\~]/ ||
length($self->{salt}) > 8;
@@ -279,7 +277,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -40,6 +40,7 @@ for any security purpose.
package Authen::Passphrase::MySQL323;
+{ use 5.006; }
use warnings;
use strict;
@@ -47,10 +48,9 @@ use Authen::Passphrase 0.003;
use Carp qw(croak);
use Crypt::MySQL 0.03 qw(password);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTOR
@@ -84,7 +84,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::MySQL323 $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -131,7 +131,7 @@ Returns the hash value, as a string of eight bytes.
=cut
sub hash {
- my Authen::Passphrase::MySQL323 $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -142,7 +142,7 @@ Returns the hash value, as a string of 16 hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::MySQL323 $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{hash});
}
@@ -153,14 +153,12 @@ This method is part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::MySQL323 $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return pack("H*", password($passphrase));
}
sub match {
- my Authen::Passphrase::MySQL323 $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
@@ -177,7 +175,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -40,6 +40,7 @@ scheme; see L<Authen::Passphrase::SaltedDigest>.
package Authen::Passphrase::MySQL41;
+{ use 5.006; }
use warnings;
use strict;
@@ -47,10 +48,9 @@ use Authen::Passphrase 0.003;
use Carp qw(croak);
use Digest::SHA1 qw(sha1);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTOR
@@ -83,7 +83,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::MySQL41 $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -130,7 +130,7 @@ Returns the hash value, as a string of 20 bytes.
=cut
sub hash {
- my Authen::Passphrase::MySQL41 $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -141,7 +141,7 @@ Returns the hash value, as a string of 40 uppercase hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::MySQL41 $self = shift;
+ my($self) = @_;
return uc(unpack("H*", $self->{hash}));
}
@@ -152,14 +152,12 @@ This method is part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::MySQL41 $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return sha1(sha1($passphrase));
}
sub match {
- my Authen::Passphrase::MySQL41 $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
@@ -176,7 +174,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -44,6 +44,7 @@ only, not by choice.
package Authen::Passphrase::NTHash;
+{ use 5.006; }
use warnings;
use strict;
@@ -51,10 +52,9 @@ use Authen::Passphrase 0.003;
use Carp qw(croak);
use Digest::MD4 1.2 qw(md4);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -87,7 +87,7 @@ Either the hash or the passphrase must be given.
sub new {
my $class = shift;
- my Authen::Passphrase::NTHash $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -178,7 +178,7 @@ Returns the hash value, as a string of 16 bytes.
=cut
sub hash {
- my Authen::Passphrase::NTHash $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -189,7 +189,7 @@ Returns the hash value, as a string of 32 hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::NTHash $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{hash});
}
@@ -204,26 +204,24 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::NTHash $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
$passphrase = substr($passphrase, 0, 128);
$passphrase =~ s/(.)/pack("v", ord($1))/eg;
return md4($passphrase);
}
sub match {
- my Authen::Passphrase::NTHash $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
sub as_crypt {
- my Authen::Passphrase::NTHash $self = shift;
+ my($self) = @_;
return "\$3\$\$".$self->hash_hex;
}
sub as_rfc2307 {
- my Authen::Passphrase::NTHash $self = shift;
+ my($self) = @_;
return "{MSNT}".$self->hash_hex;
}
@@ -240,7 +238,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -46,6 +46,7 @@ Prefer the mechanism of L<Authen::Passphrase::SaltedDigest>.
package Authen::Passphrase::NetscapeMail;
+{ use 5.006; }
use warnings;
use strict;
@@ -54,10 +55,9 @@ use Carp qw(croak);
use Data::Entropy::Algorithms 0.000 qw(rand_bits);
use Digest::MD5 1.99_53 ();
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(salt hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -102,7 +102,7 @@ The salt must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::NetscapeMail $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -180,7 +180,7 @@ Returns the salt value, as a string of 32 bytes.
=cut
sub salt {
- my Authen::Passphrase::NetscapeMail $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -191,7 +191,7 @@ Returns the hash value, as a string of 16 bytes.
=cut
sub hash {
- my Authen::Passphrase::NetscapeMail $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -202,7 +202,7 @@ Returns the hash value, as a string of 32 hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::NetscapeMail $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{hash});
}
@@ -215,8 +215,7 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::NetscapeMail $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
my $ctx = Digest::MD5->new;
$ctx->add($self->{salt});
$ctx->add("\x59");
@@ -227,13 +226,12 @@ sub _hash_of {
}
sub match {
- my Authen::Passphrase::NetscapeMail $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
sub as_rfc2307 {
- my Authen::Passphrase::NetscapeMail $self = shift;
+ my($self) = @_;
croak "can't put this salt into an RFC 2307 string"
if $self->{salt} =~ /[^!-~]/;
return "{NS-MTA-MD5}".$self->hash_hex.$self->{salt};
@@ -252,7 +250,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -60,6 +60,7 @@ to "B<z>" (in ASCII order).
package Authen::Passphrase::PHPass;
+{ use 5.006; }
use warnings;
use strict;
@@ -68,10 +69,9 @@ use Carp qw(croak);
use Data::Entropy::Algorithms 0.000 qw(rand_bits);
use Digest::MD5 1.99_53 ();
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(cost salt hash);
+use parent "Authen::Passphrase";
my $base64_digits = "./0123456789ABCDEFGHIJKLMNOPQRST".
"UVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -173,7 +173,7 @@ The cost and salt must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::PHPass $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -274,7 +274,7 @@ be performed.
=cut
sub cost {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
return $self->{cost};
}
@@ -286,7 +286,7 @@ be performed, expressed as a single base 64 digit.
=cut
sub cost_base64 {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
return substr($base64_digits, $self->{cost}, 1);
}
@@ -313,7 +313,7 @@ Returns the salt, as a string of eight bytes.
=cut
sub salt {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -324,7 +324,7 @@ Returns the hash value, as a string of 16 bytes.
=cut
sub hash {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -335,7 +335,7 @@ Returns the hash value, as a string of 22 base 64 digits.
=cut
sub hash_base64 {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
return _en_base64($self->{hash});
}
@@ -350,8 +350,7 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _hash_of {
- my Authen::Passphrase::PHPass $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
my $ctx = Digest::MD5->new;
$ctx->add($self->{salt});
$ctx->add($passphrase);
@@ -366,13 +365,12 @@ sub _hash_of {
}
sub match {
- my Authen::Passphrase::PHPass $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
sub as_crypt {
- my Authen::Passphrase::PHPass $self = shift;
+ my($self) = @_;
croak "can't put this salt into a crypt string"
if $self->{salt} =~ /[^!-9;-~]/;
return "\$P\$".$self->cost_base64.$self->{salt}.$self->hash_base64;
@@ -391,7 +389,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -35,15 +35,16 @@ passphrase access control.
package Authen::Passphrase::RejectAll;
+{ use 5.006; }
use warnings;
use strict;
use Authen::Passphrase 0.003;
use Carp qw(croak);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
+use parent "Authen::Passphrase";
# There is only one object of this class, and its content is
# insignificant.
@@ -121,7 +122,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -69,6 +69,7 @@ be expensive to compute.
package Authen::Passphrase::SaltedDigest;
+{ use 5.006; }
use warnings;
use strict;
@@ -77,13 +78,12 @@ use Carp qw(croak);
use Data::Entropy::Algorithms 0.000 qw(rand_bits);
use Digest 1.00;
use MIME::Base64 2.21 qw(encode_base64 decode_base64);
-use Module::Runtime 0.005 qw(is_valid_module_name use_module);
+use Module::Runtime 0.006 qw(is_valid_module_name use_module);
use Params::Classify 0.000 qw(is_string is_blessed);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(algorithm salt hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -159,7 +159,7 @@ The digest algorithm must be given, and either the hash or the passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::SaltedDigest $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -286,7 +286,7 @@ constructor.
=cut
sub algorithm {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
return $self->{algorithm};
}
@@ -297,7 +297,7 @@ Returns the salt, in raw form.
=cut
sub salt {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -308,7 +308,7 @@ Returns the salt, as a string of hexadecimal digits.
=cut
sub salt_hex {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{salt});
}
@@ -319,7 +319,7 @@ Returns the hash value, in raw form.
=cut
sub hash {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -330,7 +330,7 @@ Returns the hash value, as a string of hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
return unpack("H*", $self->{hash});
}
@@ -345,13 +345,12 @@ can be represented in RFC 2307 form.
=cut
sub _hash_of {
- my Authen::Passphrase::SaltedDigest $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
my $alg = $self->{algorithm};
my $ctx;
if(is_string($alg)) {
if($alg =~ /::/) {
- $alg =~ /\A(?:::)?([\w:]+)
+ $alg =~ /\A(?:::)?([0-9a-zA-Z_:]+)
(-([0-9][0-9_]*(?:\._*[0-9][0-9_]*)?)?)?\z/x
or croak "module spec `$alg' not understood";
my($pkgname, $load_p, $modver) = ($1, $2, $3);
@@ -380,8 +379,7 @@ sub _hash_of {
}
sub match {
- my Authen::Passphrase::SaltedDigest $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_hash_of($passphrase) eq $self->{hash};
}
@@ -406,13 +404,14 @@ my %rfc2307_scheme_for_package_name = (
);
sub as_rfc2307 {
- my Authen::Passphrase::SaltedDigest $self = shift;
+ my($self) = @_;
my $alg = $self->{algorithm};
my $scheme;
if(is_string($alg)) {
if($alg =~ /::/) {
$scheme = $rfc2307_scheme_for_package_name{$1}
- if $alg =~ /\A(?:::)?([\w:]+)(?:-[0-9._]*)?\z/;
+ if $alg =~ /\A(?:::)?
+ ([0-9a-zA-Z_:]+)(?:-[0-9._]*)?\z/x;
} else {
$scheme = $rfc2307_scheme_for_digest_name{$alg};
}
@@ -436,7 +435,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -74,6 +74,7 @@ matching.
package Authen::Passphrase::VMSPurdy;
+{ use 5.006; }
use warnings;
use strict;
@@ -82,10 +83,9 @@ use Authen::Passphrase 0.003;
use Carp qw(croak);
use Data::Entropy::Algorithms 0.000 qw(rand_int);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
-use base qw(Authen::Passphrase);
-use fields qw(algorithm salt username hash);
+use parent "Authen::Passphrase";
=head1 CONSTRUCTORS
@@ -149,7 +149,7 @@ passphrase.
sub new {
my $class = shift;
- my Authen::Passphrase::VMSPurdy $self = fields::new($class);
+ my $self = bless({}, $class);
my $passphrase;
while(@_) {
my $attr = shift;
@@ -272,7 +272,7 @@ processing long strings).
=cut
sub algorithm {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return $self->{algorithm};
}
@@ -284,7 +284,7 @@ uppercase, which is the canonical form.
=cut
sub username {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return $self->{username};
}
@@ -295,7 +295,7 @@ Returns the salt, as an integer.
=cut
sub salt {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return $self->{salt};
}
@@ -309,7 +309,7 @@ byte.
=cut
sub salt_hex {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return sprintf("%02X%02X", $self->{salt} & 0xff, $self->{salt} >> 8);
}
@@ -320,7 +320,7 @@ Returns the hash value, as a string of eight bytes.
=cut
sub hash {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return $self->{hash};
}
@@ -331,7 +331,7 @@ Returns the hash value, as a string of 16 uppercase hexadecimal digits.
=cut
sub hash_hex {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return uc(unpack("H*", $self->{hash}));
}
@@ -346,8 +346,7 @@ These methods are part of the standard C<Authen::Passphrase> interface.
=cut
sub _passphrase_acceptable {
- my Authen::Passphrase::VMSPurdy $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $passphrase =~ /\A[_\$0-9A-Za-z]{1,32}\z/;
}
@@ -358,15 +357,13 @@ my %hpwd_alg_num = (
);
sub _hash_of {
- my Authen::Passphrase::VMSPurdy $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return lgi_hpwd($self->{username}, uc($passphrase),
$hpwd_alg_num{$self->{algorithm}}, $self->{salt});
}
sub match {
- my Authen::Passphrase::VMSPurdy $self = shift;
- my($passphrase) = @_;
+ my($self, $passphrase) = @_;
return $self->_passphrase_acceptable($passphrase) &&
$self->_hash_of($passphrase) eq $self->{hash};
}
@@ -378,7 +375,7 @@ my %crypt_alg_num = (
);
sub as_crypt {
- my Authen::Passphrase::VMSPurdy $self = shift;
+ my($self) = @_;
return "\$VMS".$crypt_alg_num{$self->{algorithm}}."\$".
$self->salt_hex.$self->hash_hex.$self->{username};
}
@@ -396,7 +393,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -82,6 +82,7 @@ exchange of passphrase hashes.
package Authen::Passphrase;
+{ use 5.006; }
use warnings;
use strict;
@@ -89,7 +90,7 @@ use Carp qw(croak);
use MIME::Base64 2.21 qw(decode_base64);
use Module::Runtime 0.005 qw(use_module);
-our $VERSION = "0.006";
+our $VERSION = "0.007";
=head1 CONSTRUCTORS
@@ -221,8 +222,8 @@ are regarded as invalid encodings.
my %crypt_scheme_handler = (
"1" => [ "Authen::Passphrase::MD5Crypt", 0.003 ],
- "2" => [ "Authen::Passphrase::BlowfishCrypt", 0.006 ],
- "2a" => [ "Authen::Passphrase::BlowfishCrypt", 0.006 ],
+ "2" => [ "Authen::Passphrase::BlowfishCrypt", 0.007 ],
+ "2a" => [ "Authen::Passphrase::BlowfishCrypt", 0.007 ],
"3" => [ "Authen::Passphrase::NTHash", 0.003 ],
"IPB2" => sub($) { croak '$IPB2$ is unimplemented' },
"K4" => sub($) { croak '$K4$ is unimplemented' },
@@ -383,15 +384,15 @@ my %rfc2307_scheme_handler = (
"KERBEROS" => sub($) { croak "{KERBEROS} is a placeholder" },
"LANM" => [ "Authen::Passphrase::LANManager", 0.003 ],
"LANMAN" => [ "Authen::Passphrase::LANManager", 0.003 ],
- "MD4" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
- "MD5" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
+ "MD4" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
+ "MD5" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
"MSNT" => [ "Authen::Passphrase::NTHash", 0.003 ],
"NS-MTA-MD5" => [ "Authen::Passphrase::NetscapeMail", 0.003 ],
- "RMD160" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
+ "RMD160" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
"SASL" => sub($) { croak "{SASL} is a placeholder" },
- "SHA" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
- "SMD5" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
- "SSHA" => [ "Authen::Passphrase::SaltedDigest", 0.006 ],
+ "SHA" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
+ "SMD5" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
+ "SSHA" => [ "Authen::Passphrase::SaltedDigest", 0.007 ],
"UNIX" => sub($) { croak "{UNIX} is a placeholder" },
# "WM-CRY" is handled specially
);
@@ -424,7 +425,7 @@ sub from_rfc2307 {
=item $ppr->match(PASSPHRASE)
-Checks whether the supplied passphrase is correct. Returns a boolean.
+Checks whether the supplied passphrase is correct. Returns a truth value.
=item $ppr->passphrase
@@ -474,6 +475,7 @@ attacks are not appropriate implementations.
=head1 SEE ALSO
+L<MooseX::Types::Authen::Passphrase>,
L<crypt(3)>,
RFC 2307
@@ -483,7 +485,8 @@ Andrew Main (Zefram) <zefram@fysh.org>
=head1 COPYRIGHT
-Copyright (C) 2006, 2007, 2009 Andrew Main (Zefram) <zefram@fysh.org>
+Copyright (C) 2006, 2007, 2009, 2010
+Andrew Main (Zefram) <zefram@fysh.org>
=head1 LICENSE
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 14;
BEGIN { use_ok "Authen::Passphrase::AcceptAll"; }
@@ -25,3 +28,5 @@ is $ppr->passphrase, "";
is $ppr->as_crypt, "";
is $ppr->as_rfc2307, "{CRYPT}";
+
+1;
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 176;
BEGIN { use_ok "Authen::Passphrase::BigCrypt"; }
@@ -81,6 +84,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
7S 4VBRyAvp9nw
Ur 6e9cwNFemc. 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 103;
BEGIN { use_ok "Authen::Passphrase::BlowfishCrypt"; }
@@ -95,6 +98,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
0 6 Yn6x4nvPtEPkdmRQ74S1Q. ehVP/UL/xbYgKCilZtidy3nc5ttCeLa
0 6 EJv2xOCAoTkNo9y/BtUdLe OVbnD8L9oD7DVE7g0hJgCQO0YA7UHx2 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 49;
BEGIN { use_ok "Authen::Passphrase::Clear"; }
@@ -21,3 +24,5 @@ foreach my $rightphrase (@test_phrases) {
isnt $@, "";
is $ppr->as_rfc2307, "{CLEARTEXT}".$rightphrase;
}
+
+1;
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 83;
BEGIN { use_ok "Authen::Passphrase::Crypt16"; }
@@ -66,6 +69,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
7S ...........4VBRyAvp9nw
Ur ImG9Kp15IQsO2OoWANp2qc 0
@@ -1,4 +1,7 @@
-use Test::More tests => 48;
+use warnings;
+use strict;
+
+use Test::More tests => 84;
BEGIN { use_ok "Authen::Passphrase::EggdropBlowfish"; }
@@ -40,13 +43,18 @@ while(<DATA>) {
foreach my $rightphrase (sort keys %pprs) {
my $ppr = $pprs{$rightphrase};
+ ok !$ppr->match("");
foreach my $passphrase (sort keys %pprs) {
ok ($ppr->match($passphrase) xor $passphrase ne $rightphrase);
}
}
+1;
+
__DATA__
v.gq8.qm3rM1 0
V6ZOx0rVGWT0 1
AINZW/4MSzQ1 foo
V7/Cv0ShonY0 supercalifragilisticexpialidocious
+jdwmI1F5evD0 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr
+UlrmE/pDCZE/ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 77;
BEGIN { use_ok "Authen::Passphrase::DESCrypt"; }
@@ -38,6 +41,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
fiO. zjn3 EwD4x5Zn7lY
i9O/ VDnK bXjK3LN9iE2 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 71;
BEGIN { use_ok "Authen::Passphrase::DESCrypt"; }
@@ -33,6 +36,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
xIw. Alif bXjK3LN9iE2 6UN3gAqtTbM
Eoz. jn35 ACp9yg0cqDM puFoxi30V2o 0
@@ -1,8 +1,11 @@
+use warnings;
+use strict;
+
use Test::More tests => 58;
BEGIN { use_ok "Authen::Passphrase::DESCrypt"; }
-$ppr = Authen::Passphrase::DESCrypt
+my $ppr = Authen::Passphrase::DESCrypt
->new(fold => 1, initial_base64 => "6UN3gAqtTbM",
nrounds_base64 => "xIw.",
salt_base64 => "a.rS", hash_base64 => "7KB8x6lwIKQ");
@@ -84,3 +87,5 @@ is $ppr->nrounds_base64_4, "N...";
like $ppr->salt_base64_4, qr/\A..\.\.\z/;
is length($ppr->hash), 8;
ok $ppr->match("wibble");
+
+1;
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 75;
BEGIN { use_ok "Authen::Passphrase::LANManager"; }
@@ -52,6 +55,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
aad3b435b51404eeaad3b435b51404ee
25AD3B83FA6627C7AAD3B435B51404EE 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 63;
BEGIN { use_ok "Authen::Passphrase::LANManagerHalf"; }
@@ -44,6 +47,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
aad3b435b51404ee
25AD3B83FA6627C7 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 69;
BEGIN { use_ok "Authen::Passphrase::MD5Crypt"; }
@@ -51,6 +54,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
.ek8tjGw JlwHaPpGUeCpzvx6DSYt.0
ZoDb0wM1 TSZxQ/qndpG1yB9HqCMHg/ 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 59;
BEGIN { use_ok "Authen::Passphrase::MySQL323"; }
@@ -32,6 +35,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
5030573512345671
606717756665BCE6 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 59;
BEGIN { use_ok "Authen::Passphrase::MySQL41"; }
@@ -33,6 +36,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
be1bdec0aa74b4dcb079943e70528096cca985f8
B12289EEF8752AD620294A64A37CD586223AB454 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 67;
BEGIN { use_ok "Authen::Passphrase::NetscapeMail"; }
@@ -52,6 +55,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
hlV8:`2Q4?@^If)5(cf4xbDKV#o\Sk(` d019c4507be8652975e62871acaa7b52
te6]{4LF|aKFZ;Gcd0}Mul"Wmfg\;fn) 8178663855a984e46d55c57beecefdc2 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 67;
BEGIN { use_ok "Authen::Passphrase::NTHash"; }
@@ -54,6 +57,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
31d6cfe0d16ae931b73c59d7e0c089c0
7bc26760a19fc23e0996daa99744ca80 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 100;
BEGIN { use_ok "Authen::Passphrase::PHPass"; }
@@ -93,6 +96,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
6 MVeiwNN2 Z9ajy4aaEmIhSGxgfIMbF/
3 tWgAqczl uHKlOhHYT1V80gVQxgypw. 0
@@ -1,4 +1,9 @@
+use warnings;
+use strict;
+
use Test::More;
plan skip_all => "Test::Pod::Coverage not available"
unless eval "use Test::Pod::Coverage; 1";
Test::Pod::Coverage::all_pod_coverage_ok();
+
+1;
@@ -1,3 +1,8 @@
+use warnings;
+use strict;
+
use Test::More;
plan skip_all => "Test::Pod not available" unless eval "use Test::Pod 1.00; 1";
Test::Pod::all_pod_files_ok();
+
+1;
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 14;
BEGIN { use_ok "Authen::Passphrase::RejectAll"; }
@@ -26,3 +29,5 @@ isnt $@, "";
is $ppr->as_crypt, "*";
is $ppr->as_rfc2307, "{CRYPT}*";
+
+1;
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 81;
use MIME::Base64 2.21 qw(encode_base64);
@@ -64,6 +67,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
616263 900150983cd24fb0d6963f7d28e17f72
717765 ce97e12b13baef6403b5456f8fc2ce99 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 70;
use MIME::Base64 2.21 qw(encode_base64);
@@ -44,6 +47,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
616263 a9993e364706816aba3e25717850c26c9cd0d89d
717765 7cd928d1e6457c57c01f3c9442177fc62cafa56f 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 77;
BEGIN { use_ok "Authen::Passphrase::DESCrypt"; }
@@ -37,6 +40,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
Lg 3RoTEkqxIwA
f4 eGuaKa2lifE 0
@@ -1,3 +1,6 @@
+use warnings;
+use strict;
+
use Test::More tests => 110;
BEGIN { use_ok "Authen::Passphrase::VMSPurdy"; }
@@ -126,6 +129,8 @@ foreach my $rightphrase (sort keys %pprs) {
}
}
+1;
+
__DATA__
PURDY Chekov 63412 6ec0aed034aca888 0
PURDY_S Kirk 5623 4e9c1cf8b461c7ff 1